Skip to content

Conversation

@pdroalves
Copy link
Contributor

closes: please link all relevant issues

PR content/description

Check-list:

  • Tests for the changes have been added (for bug fixes / features)
  • Docs have been added / updated (for bug fixes / features)
  • Relevant issues are marked as resolved/closed, related issues are linked in the description
  • Check for breaking changes (including serialization changes) and add them to commit message following the conventional commit specification


// Modulus switch
int size = num_glwes * compression_params.glwe_dimension *
auto size = num_glwes * compression_params.glwe_dimension *
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

uint32_t seems to be fine to capture the result of that mul, otherwise we might need to cast one element to uint64_t

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks ok indeed, the first prod will always remain small and total_lwe_bodies_count would have to be insanely big to make int insufficient for this 🤔

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

int is not terrible. We still can fit a lot of LWEs in there before overflowing. However, we don't usually use that type in the rest of the library and doubling the space for size would not be bad.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yup i am a bit paranoid with the int too, prefer the uint32_t at least.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes let's go for uint32_t instead of int or auto

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok!
Done.

@pdroalves pdroalves force-pushed the pa/fix/sizetype branch 2 times, most recently from 6bc3230 to 758a065 Compare November 26, 2025 13:00
@github-actions
Copy link

❌ Milestone Missing

Please assign a milestone to this pull request. If your PR targets the next version of TFHE-rs please use the current quarter milestone, e.g. "Q1 26".
If your PR targets a patch version for previous releases: consider creating a dedicated milestone e.g. v1.5.1 if it does not exist yet.

@zama-bot zama-bot removed the approved label Jan 22, 2026
@pdroalves pdroalves added this to the v1.5.2 milestone Jan 22, 2026
@pdroalves pdroalves merged commit 222a7e9 into main Jan 22, 2026
103 of 104 checks passed
@pdroalves pdroalves deleted the pa/fix/sizetype branch January 22, 2026 09:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants